package cn.hh.ymcc.feign;

import cn.hh.ymcc.doc.CourseDoc;
import cn.hh.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 课程Es的Feign接口
 *  value = feign接口调用方       fallbackFactory=兜底类
 */

@FeignClient(value = "service-search",fallbackFactory = CourseSearchFeignClientFallBackFactory.class)
public interface CourseSearchFeignClient {

    // 添加课程到Es中
    @PostMapping("/saveCourse")
    JSONResult saveCourse(@RequestBody CourseDoc doc);

    // 删除Es中的课程
    @DeleteMapping("/deleteByIdCourse/{courseId}")
     JSONResult deleteByIdCourse(@PathVariable Long courseId);



}
